﻿Imports System.Reflection
Imports System.Reflection.Emit
Imports VBParser

Namespace Compiler.Semantic

    Public Enum SemanticStage
        NotStart
        Declared
        TypeDefinitionResolved
        MembersResolved
        CodeResolved
    End Enum

    Public MustInherit Class ContainerSyntaxNodeDescription
        Inherits CompileUnitElementDescription

        Public MustOverride Property SyntaxNode() As Tree

        Protected Sub New(ByVal parent As NameContainer)
            MyBase.New(parent)
            m_stage = SemanticStage.NotStart
            
        End Sub

        Private m_stage As SemanticStage
        ''' <summary>
        ''' Gets a value that indicate the semantic analysis stage of this node.
        ''' </summary>
        ''' <value>A value of <c>SemanticStage</c>, indicates the stage</value>
        Public Overridable Property Stage() As SemanticStage
            Get
                Return m_stage
            End Get
            Protected Set(ByVal value As SemanticStage)
                m_stage = value
            End Set
        End Property

        ''' <summary>
        ''' Initialize the description with the syntax node.
        ''' </summary>
        ''' <returns>True if the declaration is succeeded. Otherwise false.</returns>
        Public MustOverride Function DeclareSyntaxNode() As Boolean
    End Class

End Namespace
